package com.whu.service.impl;

import com.whu.aircraft.Location;
import com.whu.dao.interfaces.RoutesDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RouteService {

    @Autowired
    RoutesDao routesDao;

    public int selectAirId(String airName) {
        return routesDao.selectAirId(airName);
    }

    public int selectRoutesCount(int airId) {
        return routesDao.selectRoutesCount(airId);
    }

    public void createRoute(int airId, String routeName, String routeId) {
        routesDao.createRoute(airId, routeName, routeId);
    }

    public void insertRoutePoints(String tableName, List<Location> routePoints) {
        routesDao.insertRoutePoints(tableName, routePoints);
    }

    public String selectRouteId(int airId, String routeName) {
        return routesDao.selectRouteId(airId, routeName);
    }

}
